package com.yourname.menu;

import com.yourname.action.LoginAction;
import com.yourname.action.ScoreAction;

import java.util.Scanner;

public class FunctionMenu {
    public static void studentFunctionsMenu(){
        while (true){
            System.out.println("""
                    1. 课程管理
                    2. 打印成绩单
                    3. 返回上一级
                    """);
            Scanner scanner=new Scanner(System.in);

            int i = scanner.nextInt();
            switch (i){
                case 1-> {
                    CourseManageMenu.courseMenu(LoginAction.getLoginTag());
                }
                case 2->
                {
                    ScoreAction.print(LoginAction.getCurrent(),LoginAction.getLoginTag());
                }
            }
            if (i==3)
                break;
        }

    }
    public static void teacherFunctionsMenu(){
        while (true){
        System.out.println("""
                1. 课程管理
                2. 学生管理
                3. 成绩录入
                4. 打印成绩单
                5. 返回上一级
                """);
        Scanner scanner=new Scanner(System.in);

            int i = scanner.nextInt();
            switch (i){
                case 1-> {
                    CourseManageMenu.courseMenu(LoginAction.getLoginTag());
                }
                case 2->
                {
                    StudentManageMenu.studentMenu();
                }
                case 3->ScoreAction.addScore(LoginAction.getCurrent());
                case 4->ScoreAction.print(LoginAction.getCurrent(),LoginAction.getLoginTag());
            }
            if (i==5)
                break;
        }

    }
}
